﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace TextEditor.TextDocument.Document
{
    public interface IPageDrawing
    {
        void Draw(Graphics g);
        int X
        {
            get;
            set;
        }

        int Y
        {
            get;
            set;
        }
    }

    public class DrawString : IPageDrawing
    {
        public string value;

        public void Draw(Graphics g)
        {
            using (Brush b = new SolidBrush(foreColor))
                g.DrawString(value, font, b, x, y);
        }

        int x = 0;
        public int X
        {
            get
            {
                return x;
            }
            set
            {
                x = value;
            }
        }

        int y = 0;
        public int Y
        {
            get
            {
                return y;
            }
            set
            {
                y = value;
            }
        }

        Color foreColor = Color.Black;
        public Color ForeColor
        {
            get
            {
                return foreColor;
            }
            set
            {
                foreColor = value;
            }
        }

        Font font;

        public Font FontValue
        {
            get
            {
                return font;
            }

            set
            {
                font = value;
            }
        }
    }

    public class DrawImage : IPageDrawing
    {
        public Image value = null;
        public DrawImage(int x,int y,Image img)
        {
            value = img;
            this.x = x;
            this.y = y;

        }

        public void Draw(Graphics g)
        {
            if (this.value != null)
                g.DrawImage(value, x, y, value.Width, value.Height);
        }

        int x = 0;
        public int X
        {
            get
            {
                return x;
            }
            set
            {
                x = value;
            }
        }

        int y = 0;
        public int Y
        {
            get
            {
                return y;
            }
            set
            {
                y = value;
            }
        }
    }
}
